<template>
    <a-modal v-model:visible="isModalVisiable" :title="title" :confirm-loading="confirmLoading" @ok="confirmSubmit"
        :width="modalWidth + 'px'">
        <slot></slot>
    </a-modal>
</template>
<script lang="ts">
export default {
    name: 'BaseModal'
}
</script>
<script lang="ts" setup>
import { ref, computed, toRefs } from 'vue';
interface Props {
    isvisiable: Boolean,
    title?: string,
    modalWidth?: number,
    confirmLoading?: Boolean,
}

const props = withDefaults(defineProps<Props>(), {
    inputValue: undefined,
    modalWidth: 400,
})

const { isvisiable } = toRefs(props);
const isModalVisiable = computed(() => isvisiable.value);
const emits = defineEmits(['confirmSubmit', 'update:isvisiable', 'update:confirmLoading'])

const confirmSubmit = () => {
    emits('confirmSubmit');
};

</script>
<style lang="less" scoped>

</style>